<?php


namespace App\Http\Common;


use Illuminate\Database\Eloquent\Model;

class Book extends Model
{
    /**
     * 与模型关联的表名
     *
     * @var string
     */
    protected $table = 'book';
    public static $status = 1;//正常类型的书籍

    //作者
    public function author(){
        return $this->hasOne('App\Http\Common\Author', 'id', 'author_id');
    }

    //类别
    public function cate(){
        return $this->hasOne('App\Http\Common\Cate', 'id', 'cate_id');
    }
}